<tagLib name="html" />

<include file="Public:header" />

<div class="container" id="cpcontainer">
    <h3>{$Think.lang.register.title}</h3>
    <form name="cpform" method="post" action="__URL__/register">
    <input type="hidden" name="op" value="save" />
    <table class="tb tb2" id="register">
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.register_enable}</td></tr>
        <tr>
            <td class="vtop rowform">
	            <ul class="nofloat" onmouseover="altStyle(this)">
	            <volist name="registerEnableOptions" id="vo">
	                <li><input type="radio" name="register_enable" value="{$key}" <eq name="key" value="$registerEnableChecked">checked</eq> onclick="switchRegister(this)" /> {$vo} </li>
	            </volist>
	            </ul>
            </td>
            <td class="vtop tips2"></td>
        </tr>
        <tbody id="invite" style="display:none;">
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.max_invites_per_week}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="max_invites_per_week" value="{$rs.max_invites_per_week}" type="text" class="txt" /></td>
            <td class="vtop tips2"></td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.invite_expiration}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="invite_expiration" value="{$rs.invite_expiration}" type="text" class="txt" /></td>
            <td class="vtop tips2">{$Think.lang.register.invite_expiration_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.invite_allowed_groups}</td></tr>
        <tr>
            <td class="vtop rowform">
	            <ul class="nofloat" onmouseover="altStyle(this);">
		        	<volist name="userGroups" id="vo">
		        	<li><input type="checkbox" name="invite_allowed_groups[]" value="{$vo.group_id}" <eq name="vo.allow_invite" value="1">checked</eq> /> {$vo.name}</li>	
		        	</volist>
		        </ul>
            </td>
            <td class="vtop tips2">{$Think.lang.register.invite_allowed_groups_explain}</td>
        </tr>
        </tbody>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.require_activation}</td></tr>
        <tr>
            <td class="vtop rowform">
	            <ul class="nofloat" onmouseover="altStyle(this)">
	            <volist name="requireActivationOptions" id="vo">
	                <li><input type="radio" name="require_activation" value="{$key}" <eq name="key" value="$requireActivationChecked">checked</eq> /> {$vo} </li>
	            </volist>
	            </ul>
            </td>
            <td class="vtop tips2">{$Think.lang.register.require_activation_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.username_length}</td></tr>
        <tr>
            <td class="vtop rowform">
            	<input name="min_username_chars" value="{$rs.min_username_chars}" type="text" class="txt" /> {$Think.lang.register.min_chars} <br/><br/>
            	<input name="max_username_chars" value="{$rs.max_username_chars}" type="text" class="txt" /> {$Think.lang.register.max_chars}
            </td>
            <td class="tips2" valign="middle">{$Think.lang.register.username_length_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.pwd_length}</td></tr>
        <tr>
            <td class="vtop rowform">
            	<input name="min_pwd_chars" value="{$rs.min_pwd_chars}" type="text" class="txt" /> {$Think.lang.register.min_chars} <br/><br/>
            	<input name="max_pwd_chars" value="{$rs.max_pwd_chars}" type="text" class="txt" /> {$Think.lang.register.max_chars}
            </td>
            <td class="tips2" valign="middle">{$Think.lang.register.pwd_length_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.username_allowed_chars}</td></tr>
        <tr>
            <td class="vtop rowform">
            	<html:select name="username_allowed_chars" options="usernameAllowedCharsOptions" selected="usernameAllowedCharsSelected" />
            </td>
            <td class="tips2" valign="middle">{$Think.lang.register.username_allowed_chars_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.pwd_complex}</td></tr>
        <tr>
            <td class="vtop rowform">
            	<html:select name="pwd_complex" options="pwdComplexOptions" selected="pwdComplexSelected" />
            </td>
            <td class="tips2" valign="middle">{$Think.lang.register.pwd_complex_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.max_ip_registration}</td></tr>
        <tr>
            <td class="vtop rowform"><input name="max_ip_registration" value="{$rs.max_ip_registration}" type="text" class="txt" /></td>
            <td class="vtop tips2">{$Think.lang.register.max_ip_registration_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.welcome_msg}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="welcome_msg" radios="welcomeMsgRadios" checked="welcomeMsgChecked" separator=" " />
            </td>
            <td class="vtop tips2">{$Think.lang.register.welcome_msg_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.require_reg_agreement}</td></tr>
        <tr>
            <td class="vtop rowform">
                <html:radio name="require_reg_agreement" radios="regAgreementRadios" checked="regAgreementChecked" separator=" "/>
            </td>
            <td class="vtop tips2">{$Think.lang.register.require_reg_agreement_explain}</td>
        </tr>
        <tr class="nobg"><td colspan="2" class="td27">{$Think.lang.register.reg_agreement_details}</td></tr>
        <tr>
            <td colspan="2" class="vtop"><textarea onkeyup="textareasize(this)" name="reg_agreement_details" rows="6" cols="120">{$regAgreementDetails}</textarea></td>
        </tr>
    </table>
     <table class="tb tb2 nobdt">
        <tr class="nobg"><td colspan="15"><div class="fixsel"><input class="btn" type="submit" value="{$Think.lang.submit}" /></div></td></tr>
    </table>
    
    </form>
</div>

<include file="Public:footer" />

<script type="text/javascript">
$(function(){
	var register = '{$rs.register_enable}';
	if(register == 'invite'){
		$('#invite').show();
	}
});

function switchRegister(obj){
    if($(obj).val() == 'invite'){
        $('#invite').show();
    }else{
        $('#invite').hide();
    }
}
</script>